<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>新品列表（销售额提成）</title>
<script type="text/javascript">
	function  delproduct(id)
	{
		if(confirm("确定移除?"))
		{
			$.post("/datareport/ajaxbutton", {"op": "delproduct","id":id},
			  function(data){
				document.location.href = "/datareport/saleproductlist";
				return;
			   },"json");
		}	
	}
	
	function updatamabang(id)
	{
		if(confirm("你是否确认执行此操作?"))
		{
			$.post("/datareport/ajaxbutton", {"op": "upmabang","id":id},
			  function(data){
				  	if(data==201)
					{
						alert("该SKU已经存在于马帮数据库！")
						return;	
					}
					if(data==200)
					{
						alert("更新成功！");
						document.location.href = "/datareport/productlist";
						return;	
					}
					if(data==201)
					{
						alert("更新马帮数据库失败！")
						return;	
					}
			   },"json");
		}
	}
</script>
<body class="withvernav">
<div class="bodywrapper">
{{include file='/public/leftmenu.tpl'}}
<div class="centercontent tables">
  <div class="pageheader notab">
    <h1 class="pagetitle">新品列表（销售额提成）</h1>
    
     <div class="menulist">
        		<ul class="profile_summary">
                        <li> <a href="/datareport/addproduct?type=1" class=""><span>添加新的商品</span></a></li>
                        
                    </ul>
               </div>
    
     </div>
  <!--pageheader-->
  <div class="page">{{$pageList}} 计{{$total}}条记录，共{{$totalpage}}页</div>
  <div id="contentwrapper" class="contentwrapper"> 
    <!--搜索栏-->
    <form class="stdform stdform2" method="get" action="/datareport/saleproductlist">
      <div class="tableoptions"> 操作时间：
        <input type="text"  name="starttime" value="{{$starttime}} " onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" /> - <input type="text"  name="endtime" value="{{$endtime}} " onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" />
       关键词: <input type="text" name="other" id="other" class="width100" value="{{$other}}" />
        产品状态:
                           <select name="status" class="selection" style="width:100px;">
                            <option value="" {{if $status==""}} selected{{/if}}>请选择</option>
                                <option value="1" {{if $status==1}} selected{{/if}}>正常</option>
                                <option value="2" {{if $status==2}} selected{{/if}}>清仓</option>
                                <option value="3" {{if $status==3}} selected{{/if}}>下架</option>
                            </select>
                           
                          
                           
        &nbsp;
        <button class="btn btn_orange btn_search radius50">Search</button>
        
      </div>
    </form>
    <!--搜索栏结束-->
    
    <table cellpadding="0" cellspacing="0" border="0" class="stdtable">
      <colgroup>
      <col class="con1" />
      <col class="con0" />
      <col class="con1" />
      <col class="con0" />
      <col class="con1" />
      <col class="con0" />
      <col class="con1" />
      </colgroup>
      <thead>
        <tr>
         
          <th class="head0"><a href="/datareport/saleproductlist?orderbysku={{$orderbysku}}">商品编号</a><span style="margin-top:15px;">&nbsp;&nbsp;<img src="/fuman/images/{{if $orderbysku=='DESC'}}arrowdown{{else}}arrowup{{/if}}.png"> </span></th>
          <th class="head1">商品名称</th>
          <th class="head0">正常卖价</th>
          <th class="head1">活动价 </th>
          <th class="head0">清仓价格</th>
          <th class="head0">成本价</th>
          <th class="head0">开发者</th>
          <th class="head0">状态</th>
          <th class="head0">入库时间</th>
          <th class="head0">操作</th>
        </tr>
      </thead>
      <tbody>
      
      {{foreach from=$list item=li key=key}}
      <tr>
       
        <td>{{$li.sku}}</td>
        <td>{{$li.name}}</td>
        <td>{{$li.price}}</td>
        <td class="center">{{$li.activityprice}}</td>
        <td class="center">{{$li.clearanceprice}}</td>
        <td class="center">{{$li.costprice}}</td>
        <td class="center">{{$li.createUser}}</td>
        <td class="center">{{$li.status}}</td>
        <td class="center">{{$li.tbopertime}}</td>
        <td class="center"><a href="/datareport/addproduct?id={{$li.id}}&type=1">编辑</a>｜<a href="#" onClick="delproduct({{$li.id}})">删除</a>
        {{if $li.tb==0}}
        ｜<a href="#" onClick="updatamabang({{$li.id}})">同步马帮</a>
        {{/if}}
         {{if $li.tb==1}}
       <!-- ｜<a href="/datareport/orderlist?sku={{$li.sku}}">商品报表</a>-->
        {{/if}}
        
      
        </td>
      </tr>
      {{/foreach}}
        </tbody>
      
    </table>
    <div class="page">{{$pageList}}</div>
    <br />
    <br />
  </div>
</div>
<!--bodywrapper-->

</body>
</html>